function test(a, b) {
    var hash=[], tmp=a, tmp1, tmp2;
    var count1=0, count2=0;
    while(tmp>0) {
        tmp1 = tmp%10;
        hash[tmp1]=1;
        count1++;
        tmp = (tmp-tmp1)/10;
    }
    tmp=b;
    while(tmp>0) {
        tmp1 = tmp%10;
        if(hash[tmp1]!=1) return false;
        count2++;
        tmp = (tmp-tmp1)/10;
    }
    return count1==count2;
}

var x=1;
while(1) {
    x++;
    var tmp = 0, count=0;
    for(var i=1; i<=6; i++) {
        tmp = tmp+x;
        if(!test(x, tmp)) break;
        count++
    }
    if(count>1) {
        print("count="+count+", x=" +x)
    }
    if(count==6) {
        tmp = 0;
        for(var i=1; i<=6; i++) {
            tmp = tmp+x;
            print(tmp);
        }    
        quit();    
    }
}
